package com.chong.foundation;

public class ValueData {
    public static void main(String[] args) {
        //java数据类型

        //java字面量
        System.out.println("你好 嘻嘻嘻嘻嘻");

        //正数
        System.out.println(6666);
        System.out.println(-7777);

        //小数  带有小数点
        System.out.println(1.13);
        System.out.println(-1.38);


        //字符串  双引号且字符数大于2个
        System.out.println("你好呀");
        System.out.println("6666");

        //字符类型 单引号 字符数有且只有1个
        System.out.println('黑');
        System.out.println('马');

        //布尔值
        System.out.println(false);
        System.out.println(true);

        //空类型
        //细节:null不能直接打印的
        //如果要打印的null 只能以字符串形式打印
        System.out.println("null");


        // 定义变量

        /**
         * 基本数据类型
         * 整数：byte short int long
         * 浮点数：float double
         * 字符：char
         * 布尔：boolean
         * 整数和小数取值范围大小关系：double>float>long>int>short>byte
         */

        //byte整数:-128到127
        byte b = 10;
        System.out.print(b + "\n");

        //short整数 -32768到32767
        short s = 20;
        System.out.print(s + "\n");

        //int整数 -2147483648到2147483647（10位数）
        int i = 30;
        System.out.print(i + "\n");

        //long整数  -9223372036854775808到9223372036854775807(19位数)
        long h = 99999999999L;
        System.out.print(h + "\n");

       //float浮点数  -3.401298e-38到3.402823e+38
        float f = 3.14156F;
        System.out.print(f + "\n");

        // double浮点数   -4.9000000e-324到3241.797693e+308
        double d = 20.2;
        System.out.print(d + "\n");


        //char字符 0-65535
        char c = '中';
        System.out.print(c + "\n");

        //boolean布尔值 true false
        boolean o = false;
        System.out.print(o + "\n");


        String name = "陈冲";
        int age = 18;
        char gender = '男';
        double height = 180.1;
        boolean flag = true;

        System.out.print(name);
        System.out.print(age);
        System.out.print(gender);
        System.out.print(height);
        System.out.print(flag);
    }
}
